package com.competition.reception.controller;


import com.competition.commonutils.R;
import com.competition.reception.entity.ModulePicture;
import com.competition.reception.service.ModulePictureService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 富文本编辑器图片路径 前端控制器
 * </p>
 *
 * @author testjava
 * @since 2021-04-03
 */
@RestController
@RequestMapping("/reception/module-picture")
@CrossOrigin
@Api("关于模块图片相关的接口")
public class ModulePictureController {

    @Autowired
    private ModulePictureService modulePictureService;

    @PostMapping("addmodulePicture")
    @ApiOperation("批量保存图片路径到数据库中")
    public R addModulePicture(@RequestBody ModulePicture[] modulePictures){
        for (int i=0;i<modulePictures.length;i++){
            modulePictureService.save(modulePictures[i]);
        }
        return R.ok();
    }

}

